package c.d.a.a.h;

import android.view.GestureDetector;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.View.OnTouchListener;
import com.github.mikephil.charting.charts.Chart;

/* compiled from: ChartTouchListener */
public abstract class b<T extends Chart<?>> extends SimpleOnGestureListener implements OnTouchListener {
    public a a = a.NONE;
    public int b = 0;
    public c.d.a.a.e.b c;
    public GestureDetector d;
    public T e;

    /* compiled from: ChartTouchListener */
    public enum a {
        NONE,
        DRAG,
        X_ZOOM,
        Y_ZOOM,
        PINCH_ZOOM,
        ROTATE,
        SINGLE_TAP,
        DOUBLE_TAP,
        LONG_PRESS,
        FLING
    }

    public b(T t) {
        this.e = t;
        this.d = new GestureDetector(t.getContext(), this);
    }

    public void a(c.d.a.a.e.b bVar) {
        if (bVar == null || bVar.a(this.c)) {
            this.e.h(null, true);
            this.c = null;
            return;
        }
        this.e.h(bVar, true);
        this.c = bVar;
    }
}
